home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / DOpus_SDK_5.5 / docs / bufferedio.doc < prev    next >
Text File  |  1996-09-05  |  5KB  |  216 lines

  1. TABLE OF CONTENTS
  2.  
  3. dopus5.library/CloseBuf
  4. dopus5.library/ExamineBuf
  5. dopus5.library/FHFromBuf
  6. dopus5.library/FlushBuf
  7. dopus5.library/OpenBuf
  8. dopus5.library/ReadBuf
  9. dopus5.library/SeekBuf
  10. dopus5.library/WriteBuf
  11. dopus5.library/CloseBuf                               dopus5.library/CloseBuf
  12.  
  13.     NAME
  14.         CloseBuf - close a buffered file
  15.  
  16.     SYNOPSIS
  17.         CloseBuf(file)
  18.                   A0
  19.  
  20.         void CloseBuf(APTR);
  21.  
  22.     FUNCTION
  23.         Closes a file opened with OpenBuf().
  24.  
  25.     INPUTS
  26.         file - file to close
  27.  
  28.     RESULT
  29.         Any write data in the buffer is written to disk and the
  30.         file is closed.
  31.  
  32.     SEE ALSO
  33.         OpenBuf()
  34. dopus5.library/ExamineBuf                           dopus5.library/ExamineBuf
  35.  
  36.     NAME
  37.         ExamineBuf - Examine an open file
  38.  
  39.     SYNOPSIS
  40.         ExamineBuf(file, fib)
  41.                     A0    A1
  42.  
  43.         long ExamineBuf(APTR, struct FileInfoBlock *);
  44.  
  45.     FUNCTION
  46.         This function calls ExamineFH() on the underlying DOS file handle.
  47.  
  48.     INPUTS
  49.         file - file to examine
  50.         fib - FileInfoBlock structure, must be longword aligned
  51.  
  52.     RESULT
  53.         Returns DOSTRUE if successful. The FileInfoBlock will contain
  54.         information about the open file.
  55.  
  56.     BUGS
  57.         If the file is open for writing, the file size reported by this
  58.         function may not be accurate.
  59.  
  60.     SEE ALSO
  61.         OpenBuf(), dos.library/ExamineFH()
  62.  
  63. dopus5.library/FHFromBuf                             dopus5.library/FHFromBuf
  64.  
  65.     NAME
  66.         FHFromBuf - get DOS file handle
  67.  
  68.     SYNOPSIS
  69.         FHFromBuf(file)
  70.                    A0
  71.  
  72.         BPTR FHFromBuf(APTR);
  73.  
  74.     FUNCTION
  75.         This function returns the underlying DOS file handle for a
  76.         buffered IO handle.
  77.  
  78.     INPUTS
  79.         file - buffered IO file handle
  80.  
  81.     RESULT
  82.         Returns the file handle.
  83.  
  84.     SEE ALSO
  85.         OpenBuf()
  86. dopus5.library/FlushBuf                               dopus5.library/FlushBuf
  87.  
  88.     NAME
  89.         FlushBuf - flush file buffer
  90.  
  91.     SYNOPSIS
  92.         FlushBuf(file)
  93.                   A0
  94.  
  95.         void FlushBuf(APTR);
  96.  
  97.     FUNCTION
  98.         This function flushes the buffer of a buffered IO file. If there
  99.         is any write data in the buffer, it is written to disk.
  100.  
  101.     INPUTS
  102.         file - file handle to flush
  103.  
  104.     RESULT
  105.         The buffer is flushed.
  106.  
  107.     NOTES
  108.         In practice, you never need to call this function.
  109.  
  110.     SEE ALSO
  111.         OpenBuf(), WriteBuf(), ReadBuf()
  112. dopus5.library/OpenBuf                                 dopus5.library/OpenBuf
  113.  
  114.     NAME
  115.         OpenBuf - open a file for buffered I/O
  116.  
  117.     SYNOPSIS
  118.         OpenBuf(name, mode, bufsize)
  119.                  A0    D0     D1
  120.  
  121.         APTR OpenBuf(char *, long, long);
  122.  
  123.     FUNCTION
  124.         This function opens a file for use with the buffered I/O routines.
  125.  
  126.     INPUTS
  127.         name - name of the file to open
  128.         mode - mode to use
  129.         bufsize - size of the buffer to use
  130.  
  131.     RESULT
  132.         Returns a buffered file handle if successful, or NULL. This is
  133.         not a standard DOS file handle, and can only be used with the
  134.         other buffered IO functions.
  135.  
  136.     SEE ALSO
  137.         CloseBuf(), dos.library/Open()
  138. dopus5.library/ReadBuf                                 dopus5.library/ReadBuf
  139.  
  140.     NAME
  141.         ReadBuf - read data from a buffered file
  142.  
  143.     SYNOPSIS
  144.         ReadBuf(file, buffer, size)
  145.                  A0     A1     D0
  146.  
  147.         long ReadBuf(APTR, char *, long);
  148.  
  149.     FUNCTION
  150.         This function reads data from a buffered IO file.
  151.  
  152.     INPUTS
  153.         file - buffered IO file handle
  154.         buffer - buffer to place data in
  155.         size - size to read
  156.  
  157.     RESULT
  158.         This function returns the size of the data actually read,
  159.         or -1 if an error occurred.
  160.  
  161.     SEE ALSO
  162.         OpenBuf(), dos.library/Read()
  163.  
  164. dopus5.library/SeekBuf                                 dopus5.library/SeekBuf
  165.  
  166.     NAME
  167.         SeekBuf - seek within a buffered IO file
  168.  
  169.     SYNOPSIS
  170.         SeekBuf(file, offset, mode)
  171.                  A0     D0     D1
  172.  
  173.         long SeekBuf(APTR, long, long);
  174.  
  175.     FUNCTION
  176.         This function sets the read/write position for a buffered IO file.
  177.         If the seek takes the position outside of the current buffer, the
  178.         buffer will be flushed and re-read automatically.
  179.  
  180.     INPUTS
  181.         file - file to seek within
  182.         offset - offset to seek
  183.         mode - type of seet (OFFSET_BEGINNING, OFFSET_CURRENT, OFFSET_END)
  184.  
  185.     RESULT
  186.         Returns the previous file position.
  187.  
  188.     SEE ALSO
  189.         OpenBuf(), dos.library/Seek()
  190.  
  191. dopus5.library/WriteBuf                               dopus5.library/WriteBuf
  192.  
  193.     NAME
  194.         WriteBuf - write data to a buffered IO file
  195.  
  196.     SYNOPSIS
  197.         WriteBuf(file, data, size)
  198.                   A0    A1    D0
  199.  
  200.         long WriteBuf(APTR, char *, long);
  201.  
  202.     FUNCTION
  203.         Writes data to a file opened for buffered IO.
  204.  
  205.     INPUTS
  206.         file - file handle
  207.         data - data to write
  208.         size - size to write (-1 works for a null-terminated string)
  209.  
  210.     RESULT
  211.         Returns the number of bytes written, or -1 for an error.
  212.  
  213.     SEE ALSO
  214.         OpenBuf(), dos.library/Write()
  215.  
  216.